package com.ambow.service.master.sysoperationlog.service;

import com.ambow.service.master.sysoperationlog.dao.SysOperationLogDao;
import com.ambow.service.master.sysoperationlog.dto.SysOperationLogDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * @classname: SysOperationLogService
 * @description: 定义 sys_operation_log 实现类
 * @author:  root
 */
@Service
@Slf4j
public class SysOperationLogService {

	@Autowired
	private SysOperationLogDao sysOperationLogDao;

	// 添加日志
	@Transactional(rollbackFor = {Exception.class})
	public int insertSysOperationLog(SysOperationLogDTO sysOperationLogDTO)throws Exception{
		int count = sysOperationLogDao.insertSysOperationLog(sysOperationLogDTO);
		return count;
	}

	// 获取SysOperationLog列表
	public List<SysOperationLogDTO> searchSysOperationLog(SysOperationLogDTO sysOperationLogDTO) throws Exception {
		List<SysOperationLogDTO> dataList =  sysOperationLogDao.searchSysOperationLog(sysOperationLogDTO);
		return dataList;
	}

}

